package com.xiaoxu.auth.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Service;

/**
 * @author xiaoxu
 * @version 1.0
 * @description TODO
 * @date 2023/2/2 14:33
 */
@Service
@Slf4j
public class DaoAuthenticationProviderCustom extends DaoAuthenticationProvider {

     @Autowired
     public void setUserDetailsService(UserDetailsService userDetailsService){
          super.setUserDetailsService(userDetailsService);
     }

     public void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException{
         //设为空方法体，不再用原始方法校验密码
     }


}
